function rename(img)
{
    if($('#Files_name').val()!=undefined){
        var oldName=$('#Files_name').val();
    }
    if($('#Directories_name').val()!=undefined){
        var oldName=$('#Directories_name').val();
    }
    if($('#Files').val()!=undefined){
        var oldName=$('#Files').val();
        var arr=oldName.split('.');
        oldName=arr[0];
    }

    $('#old-name').val(oldName+'-1');

    for(var key in img){
        if(img[key]==oldName){
            $("#updateOptions").dialog("open");
            return false;
        }
    }

    return true;
}